package com.heyqing.topic.IsPowerOfFour_0342;

/**
 * ClassName:IsPowerOfFour
 * Package:com.heyqing.topic.IsPowerOfFour_0342
 * Description:
 *
 * @Date:2024/9/27
 * @Author:Heyqing
 */
public class IsPowerOfFour {
    public boolean isPowerOfFour(int n) {
        if (n <= 0) return false;
        return n - Math.pow(4, Math.ceil(Math.log(n) / Math.log(4))) == 0;
    }
}
